<template>
	<view>

		<!-- 封装头部tab栏 -->
		<NewsNavBar :tabBars='tabBars' :tabIndex='tabIndex' @ChangeIndex='changeIndex'></NewsNavBar>
		<!--  滑到列表栏 -->
		<!--   封装一个news 列表栏组件 -->
		<NewsSwiperList :guanzhu='guanzhu'  	:tabIndex='tabIndex'  @TabChangeIndex='tabChangeIndex'></NewsSwiperList>



		<!-- <block v-for='(item,index)  in list'>


			<CommonList :item='item'></CommonList>
		</block> -->
	</view>
</template>

<script>
	import NewsNavBar from '../../components/news/news-nav-bar.vue'



	import NewsSwiperList from '../../components/news/news-swiper-list.vue'

	export default {
		components: {

			NewsNavBar,
			NewsSwiperList

		},
		data() {
			return {


				tabBars: [{
						name: "关注",
						id: "guanzhu"
					},
					{
						name: "话题",
						id: "topic"
					}


				],
				tabIndex: 0,


				guanzhu: {
					loadtext: "上拉加载更多",
					list: [
						// 文字
						{
							userpic: "../../static/demo/userpic/12.jpg",
							username: "哈哈",
							sex: 0, //0 男 1 女
							age: 25,
							isguanzhu: false,
							title: "我是标题",
							titlepic: "",
							video: false,
							share: false,
							path: "深圳 龙岗",
							sharenum: 20,
							commentnum: 30,
							goodnum: 20
						},
						// 图文
						{
							userpic: "../../static/demo/userpic/12.jpg",
							username: "哈哈",
							sex: 0, //0 男 1 女
							age: 25,
							isguanzhu: false,
							title: "我是标题",
							titlepic: "../../static/demo/datapic/13.jpg",
							video: false,
							share: false,
							path: "深圳 龙岗",
							sharenum: 20,
							commentnum: 30,
							goodnum: 20
						},
						// 视频
						{
							userpic: "../../static/demo/userpic/12.jpg",
							username: "哈哈",
							sex: 0, //0 男 1 女
							age: 25,
							isguanzhu: false,
							title: "我是标题",
							titlepic: "../../static/demo/datapic/13.jpg",
							video: {
								looknum: "20w",
								long: "2:47"
							},
							share: false,
							path: "深圳 龙岗",
							sharenum: 20,
							commentnum: 30,
							goodnum: 20
						},
						// 分享
						{
							userpic: "../../static/demo/userpic/12.jpg",
							username: "哈哈",
							sex: 0, //0 男 1 女
							age: 25,
							isguanzhu: false,
							title: "我是标题",
							titlepic: "",
							video: false,
							share: {
								title: "我是分享的标题",
								titlepic: "../../static/demo/datapic/14.jpg"
							},
							path: "深圳 龙岗",
							sharenum: 20,
							commentnum: 30,
							goodnum: 20
						},
					]
				},


				

			}
		},
		methods: {

			changeIndex(index) {
				this.tabIndex = index
			},
			
			tabChangeIndex(index) {
				this.tabIndex=index
			},


			


		

		}
	}
</script>

<style scoped>

</style>
